<template>
  <div>
    <div>{{ name }}</div>
    <div>{{ time }}</div>
    <div v-for="item in list" :key="item.suId">
      <img :src="item.image" alt="" />
      <p>{{ item.title }}</p>
    </div>
  </div>
</template>

<script>
// import { defineComponent, reactive, onMounted } from "vue";
import common from "Common";
import axios from "axios";
// export default defineComponent({
//   setup() {
//     let data = reactive({
//       time: new Date().getTime(),
//     });
//     onMounted(() => {
//       console.log("a-----", common);
//     });
//     return {
//       data,
//     };
//   },
//   components:{
//       test
//   }
// });

export default {
  data() {
    return {
      name: "张大亮",
      time: new Date().getTime(),
      detail: common.index,
      list: this.$ssrData? this.$ssrData.list: (window.$ssrData? window.$ssrData.list : []),
    };
  },
  async ssrAsync() {
    const res = await axios({
      url: "https://www.fastmock.site/mock/1b516ee436823f74b01007ccde90885d/by1-2/acquireProductFeed",
      method: "post",
    });
    return {
      list: res.data.success == 1 ? res.data.data.list : [],
    };
  },
};
</script>

<style>
</style>